from tortoise import fields

from .base import BaseModel, TimestampMixin


class User(BaseModel, TimestampMixin):
    username = fields.CharField(max_length=20, unique=True, description="用户名称", index=True)
    realName = fields.CharField(max_length=30, null=True, description="姓名", index=True)
    password = fields.CharField(max_length=128, null=True, description="密码")
    last_login = fields.DatetimeField(null=True, description="最后登录时间", index=True)
    avatar = fields.TextField(null=True, description="头像")

    class Meta:
        table = "user"



